package com.softeem.map;

import java.util.HashMap;
import java.util.Hashtable;

/**
 * HashTable:
 *  当前存储元素的时候,键不能为null,值也不能为null
 */
public class HashTable {
    public static void main(String[] args) {
        //map集合是一个无序的集合
        HashMap<String,String> map = new HashMap<String,String>();
        map.put("1","张三");
        map.put("二","李四");
        map.put(null,"王五");
        map.put("3",null);
        map.put(null,null);
        System.out.println(map);


        Hashtable<String,String> table = new Hashtable<String,String>();
        table.put("1","张三");
        table.put("二","李四");
        //table.put(null,"王五");
        //table.put("3",null);
        //table.put(null,null);
        System.out.println(table);
    }
}
